<div class="span9">
	<legend>
		<div class="row-fluid">
			<div class="span8">
				<h2>Blog</h2>
			</div>
			<div class="span4" style="text-align:right;">
				<h2><a class="btn" href="/blog/add"><i class="icon-plus"></i> <strong>VIẾT BLOG</strong></a></h2>
			</div>
		</div>
	</legend>
	<?php if(!empty($this->newBlogs)){?>
		<?php $i = 0 ?>
		<?php foreach($this->newBlogs as $blog){ ?>
			<?php if ($i == 0){ ?><div class="row-fluid"><?php } ?>
            <div class="span4">
            	<div class="blog-thumb"><img src="<?php echo $blog['image'];?>" class="img-polaroid"></div>
              <h4><?php echo $blog['title'];?></h4>
              <small class="txtgrey">Người gửi: <a href="/blog/index/usid/<?php echo $blog['uid']; ?>"><?php echo $blog['fullname']; ?></a></small>
              <p style="text-align:justify"><?php echo $blog['content'];?></p>
              <p><a class="btn" href="/blog/detail/bid/<?php echo $blog['id']; ?>">Xem thêm &raquo;</a></p>
            </div><!--/span-->
            <?php $i++ ?>
            <?php if($i == 3){ $i = 0;?>
            	</div><div class="blog-thumb-line"></div><!--/row-->
            <?php }?>		
		<?php } ?>
		<?php if($i != 0){ ?> </div><div class="blog-thumb-line"></div> <?php } ?>
	<?php }else{ ?>
    <div class="row-fluid">
      <div class="span12">
        <p class="text-info" style="text-align:center;">Chưa có blog nào !</p>
      </div>
    </div>
  <?php } ?>
</div><!--/span-->
<div class="span3">
  <?php if (!empty($_SESSION['logginUser'])){?>
  <div>
    <p>Chào <a href="/blog/index/usid/<?php echo $_SESSION['logginUser']['uid']; ?>"><?php echo $_SESSION['logginUser']['fullname']; ?></a></p>
  </div>
  <?php }?>
  <div class="well sidebar-nav">
    <ul class="nav nav-list">
      <li class="nav-header">Top bloggers</li>
      <?php if(!empty($this->topBlogger) && !empty($this->bloggers)) {?>
      <?php foreach($this->topBlogger as $blogger){?>
      <li><a href="/blog/index/usid/<?php echo $blogger['uid'];?>">
        <p><img class="nav-header" src="<?php echo $this->bloggers[$blogger['uid']]['avatar'] ?>" /></p>
        <p><?php echo $this->bloggers[$blogger['uid']]['fullname'] ?> (<?php echo $blogger['total'];?>)</p></a></li>
      <?php } ?>
      <?php } ?>
    </ul>
  </div><!--/.well -->
</div><!--/span-->